package com.rh.feign_service;

import com.rh.result.ResultVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Component //Spring管理，这样防止在其他位置注入时报错
//Hystrix和Feign的服务降级,name:微服务名称 fallback:hystrix降级类
@FeignClient(name = "service-vod",fallback = FeignDegrade.class)  //调用service-vod组件，服务名一定要写正确
public interface FeignEduService {
   //调用service-vod中的方法路径(只写接口地址和方法)

    @ApiOperation(value = "2.根据视频id删除阿里云中的视频")
    @DeleteMapping("/eduvod/video/removeAlyVideo/{videoId}")//这里路径要写全了
    //当有@PathVariable注解时,一定要指定参数,不然这里找不到
    public ResultVo removeAlyVideo(@PathVariable("videoId") String videoId);

    @ApiOperation(value = "3.删除多个阿里云视频")
    @DeleteMapping("/eduvod/video/delete-batch")
    public ResultVo deleteBatchVideo(@RequestParam("videoIdList") List<String> videoIdList);
}
